Full source code website bán hàng thương mại điện tử gần giống shopee
468.891 lượt xem;
1 <?
2 $MAXPAGE=GetConfig('maxpage');
3
4 if ( ! function_exists('session_is_registered')){
5 function session_is_registered($x)
6 {
7 return isset($_SESSION[$x]);
8 }
9 }
10
11
12 function GetListLanguage()
13 {
14 global $con;
15 $ret=array();
16 $result = mysql_query("select * from languages order by languages_order",$con);
17 while (($row=mysql_fetch_assoc($result)))
18 $ret[]=array($row['languages_id'],$row['languages_name']);
19 return $ret;
20 }
21
22 function GetCustomerInfo($id)
23 {
24 global $con;
25 if ($id=="") return false;
26 $result = mysql_query("select * from user_shop where id=$id limit 1",$con);
27 return mysql_fetch_assoc($result);
28 }
29
30 function GetOrderInfo($id)
31 {
32 global $con;
33 if ($id=="") return false;
34 $result = mysql_query("select * from orders where orders_id=$id limit 1",$con);
35 return mysql_fetch_assoc($result);
36 }
37
38 function GetListAlbumCategory($catid="",$split="==")
39 {
40 global $con;
41 $ret=array();
42 if ($catid=="") $catid=0;
43 $result = mysql_query("select * from album_categories where album_categories_parentid=$catid",$con);
44 while (($row=mysql_fetch_assoc($result)))
45 {
46 $ret[]=array($row['album_categories_id'],($catid==0?"":$split).$row['album_categories_name']);
47 $getsub=GetListAlbumCategory($row['album_categories_id'],$split.$split);
48 foreach ($getsub as $sub)
49 $ret[]=array($sub[0],$sub[1]);
50 }
51 return $ret;
52 }
53 ?>
2 $MAXPAGE=GetConfig('maxpage');
3
4 if ( ! function_exists('session_is_registered')){
5 function session_is_registered($x)
6 {
7 return isset($_SESSION[$x]);
8 }
9 }
10
11
12 function GetListLanguage()
13 {
14 global $con;
15 $ret=array();
16 $result = mysql_query("select * from languages order by languages_order",$con);
17 while (($row=mysql_fetch_assoc($result)))
18 $ret[]=array($row['languages_id'],$row['languages_name']);
19 return $ret;
20 }
21
22 function GetCustomerInfo($id)
23 {
24 global $con;
25 if ($id=="") return false;
26 $result = mysql_query("select * from user_shop where id=$id limit 1",$con);
27 return mysql_fetch_assoc($result);
28 }
29
30 function GetOrderInfo($id)
31 {
32 global $con;
33 if ($id=="") return false;
34 $result = mysql_query("select * from orders where orders_id=$id limit 1",$con);
35 return mysql_fetch_assoc($result);
36 }
37
38 function GetListAlbumCategory($catid="",$split="==")
39 {
40 global $con;
41 $ret=array();
42 if ($catid=="") $catid=0;
43 $result = mysql_query("select * from album_categories where album_categories_parentid=$catid",$con);
44 while (($row=mysql_fetch_assoc($result)))
45 {
46 $ret[]=array($row['album_categories_id'],($catid==0?"":$split).$row['album_categories_name']);
47 $getsub=GetListAlbumCategory($row['album_categories_id'],$split.$split);
48 foreach ($getsub as $sub)
49 $ret[]=array($sub[0],$sub[1]);
50 }
51 return $ret;
52 }
53 ?>